In earlier versions of FB and using PG we had a very easy to use method of creating and viewing lists. To date we don't have an OSX version of that set of commands so I created this list manager for my own use. It has the ability to display lists in any desired font, size and color and can also display small graphics. It uses String Resources for the text at this point but small modifications could use anything.
The first thing to do to create the list is review the record we create for managing lists and list display. Here is the basics.
BEGIN Record ListRecord
DIM as int ncols 'number
of colums
dim as long numRecords 'number
of records filled in after first drawing
dim as int STResNo 'Using
a String Resource in this example
DIM as int LScrollBtn
DIM as LONG LScrlBtnMax
dim as rect ListRect 'The
overall rectangle for the list
DIM as rect selrect[20]
DIM as int colwd%[20] '20
columns each can have their own width
Dim as RGBCOLOR RGB[20] 'each
column can have a different color
DIM as INT txtalign[20] 'left
= 0, right = 1, center = 2
DIM as int oldselect 'the
list row previously selected
dim as int newselect 'the
new selection if there is one
dim as int WhichString 'which
string in the resouce selected
DIM as INT buttonsized
dim as int fnt 'the
font to use
dim as int sze 'the
size to use
dim as int styl 'the
style to use
DIM as str255 2 delim$ 'the
delimiting character for each row
DIM as str255 2 icon$ 'the
delim string noting what follows is an icon id and not a string
end record
Using this record format we initialize the list using a local function to set the above items or get them from a preference and then set them
Two basic functions handle the list from here on.
1. DoListSelection$ Detects a mouse click on the list and returns the text for that cell. It also detects if you moved the mouse up or down in the list and above or below the list rectangle to correctly redraw the list.
2. DrawList takes the responsibility for drawing the list. Follow the code and you can see how we set colors for the text and cells, draw the selected cell and draw an icon with the cell if you have set the list up that way.
To add new topics you simply drop them in the Help folder. Each time the help window is displayed it rebuilds the list of topics from the contents of the Help folder.
Mostly these few help topics are just for blah, blah to show the help system. More notes exist on the code.